<style>
body {
	background: #fbefe2;
}
ul.square {list-style-type:square}
.green {color:#09ba07}
.green-bg {background:#09ba07}
.fui-content{background:#fbefe2}
.fui-list-inner .vip {
	background: #09ba07 none repeat scroll 0 0;
    color: #fff;
    position: absolute;
    margin-left: 0.2rem;
    height: 0.75rem;
    width: 0.75rem;
    vertical-align: top;
    z-index: 100;
    line-height: 1.1;
    text-align: center;
    border-radius: 0.85rem;
}
.fui-cell.post-image { display: none}

.fui-list-media .r-icon{height:1.3rem;width:1.3rem;border-radius:100%;background:#09ba07}

.sns-post-detail-page .text-reply {
    padding:.2rem 0;color:red; color:#333; font-size:.75rem; word-break: break-all;
}
.sns-post-detail-page .text-time {
    color:red; color:#999; padding-top:.2rem;
}

.sns-post-detail-page .text-remark {
    font-size:.6rem;
}
.sns-post-detail-page .text-time .link { color: #999; }
.sns-post-detail-page .text-time .link .icon { font-size:.6rem;}
.sns-post-detail-page .text-time .link.selected { color: #1c84c6}
.sns-post-detail-page .text-parent {
    margin-left:.2rem;
    margin-top:.2rem;
    padding-bottom:.2rem;
}
.text-parent .org{color:#eb7350;}


.sns-post-detail-page .reply-list {

    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    -ms-flex-align: start;
    align-items: start;
    height:auto;
}

.sns-post-detail-page .reply-avatar {
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    -ms-flex-align: start;
    align-items: start;
    height:auto;
}

.sns-post-detail-page .reply-avatar img {
    width:2rem;height:2rem;
    -webkit-border-radius:2rem;
    -moz-border-radius:2rem;
    border-radius:2rem;


}
.sns-post-detail-page .post-detail-avatar img {
    width:2.2rem;height:2.2rem;
    -webkit-border-radius:2.2rem;
    -moz-border-radius:2.2rem;
    border-radius:2.2rem;

}
.item-content {background-color: #fff;border-radius: 10px;padding:0.5rem;margin:0.5rem}
.item-buy-log {margin:0.2rem;padding: 0.5rem;background-color: #def9eb;border-radius: 10px;}
.item-line-nav {margin:0.2rem;padding: 0.1rem;background-color: #def9eb;border-radius: 10px;text-align:center;line-height:1.2rem}
.item-follow-line {border-bottom: 1px solid #ebebeb;color:#61bba7;font-size:0.56rem;padding-bottom:0.3rem}
.item-msg-line {font-size:0.56rem;padding-top:0.3rem}
</style>
<div class="fui-page fui-page-current  fui-page-current" >
	<div class="fui-content navbar">
		<div class="fui-shopsign">
				<div class="store">
					<img class="storeimg" src="{{tomedia(pagedata.pluginset.o_img) || '../addons/jy_zhaopin/resource/images/banner.png'}}" style="max-height:400px"/>
					<div class="fui-list-group" style="margin:5px;">
						<div class="fui-list">
							<div class="fui-list-media" ng-click="access_json('/index//quanid='+pagedata.user.mid)">
								<img src="{{tomedia(pagedata.member.avatar || '../core/resource/images/nopic.jpg')}}" style=" border-radius: 10px;width:2rem;height:2rem">
							</div>
							<div class="fui-list-inner" ng-click="access_json('/index//quanid='+pagedata.user.mid)">
								<div class="title" style="color:#333">{{pagedata.member.nickname || '未知用户'}}<span ng-if="member.isvip==1" class="vip"><i class="icon jinyunicon icon-vip5" style="font-size:0.5rem;padding-left:0.1rem;color:#fff"></i></span></div>
								<div class="text" style="color:#999;font-size:0.56rem"> {{pagedata.item.createtime || '12/20 11:18'}} 有{{pagedata.item.looks || 0}}人看过</div>
							</div>
							<div class="fui-list-media">
								<span class="r-icon" onclick="$('#showsharecover').modal();">
									<i class="icon icon-weixin-copy" style="padding:0.2rem;color:#fff"></i>
								</span>
								<span class="r-icon" style="background:#f60;margin-left:0.6rem" onclick="$('#showsharecover').modal();">
									<i class="icon icon-skip" style="padding:0.2rem;color:#fff"></i>
								</span>
							</div>
							
						</div>
					</div>
				</div>
		</div>
		<div class="content-block item-content">
			<div ng-if="pagedata.merch.id" class="fui-cell-group fui-shop-group" style="margin-top:0">
				<a class='fui-list' href="javascript:" ng-click="access_json('jy_weishop/merch//id='+pagedata.merch.id)">
					<div class='fui-list-media'>
						<img ng-src="{{tomedia(pagedata.merch.logo) || '../core/resource/images/nopic.jpg'}}" />
					</div>
					<div class='fui-list-inner'>
						<div class='title'>{{pagedata.merch.merchname}} <i class="fui-tag fui-tag-red">单位</i></div>
						<div class='subtitle'>{{pagedata.merch.desc || '没有描述'}}</div>
					</div>
					<div class="fui-list-angle " style="margin-right: 0.2rem">
							<span class="btn btn-default-o external goshop">单位详情</span>
					</div>
				</a>
			</div>
			<div class="fui-card-content" style="margin-bottom:0.5rem">
				<b class="fui-card-content-title">
					{{pagedata.item.title || '没有标题'}}
				</b>
			</div>
			<div class="content-images">
				<div style="margin-bottom:0.3rem">
					<div>
						<div ng-if="pagedata.item.type==1" class="text">公司名：<span class="text-gray">{{pagedata.item.company_title}}</span></div>
						<div class="text">岗位：<span class="text-gray">{{pagedata.item.company_jobname}}</span></div>
						<div class="text">薪资待遇：<span class="text-gray">{{pagedata.item.pay}}</span></div>
					</div>
					<div>
						<div class="text">年龄：<span class="text-gray">{{pagedata.item.age}}</span></div>
						<div class="text">学历：<span class="text-gray">{{pagedata.item.educationid}}</span></div>
						<div ng-if="pagedata.item.type!=1" class="text">毕业院校：<span class="text-gray">{{pagedata.item.school}}</span></div>
					</div>
					<div>
						<div class="text">{{pagedata.item.type!=1?'要求经验':'从事经验'}}：<span class="text-gray">{{pagedata.item.timesid}}</span></div>
					</div>
					<div>
						<div class="text">{{pagedata.item.type!=1?'性别要求':'性别'}}：<span class="text-gray">{{pagedata.item.sex}}</span></div>
					</div>
				</div>
				<div style="margin-bottom:0.3rem" ng-if="pagedata.item.diyfileds.length>0">
					<div ng-repeat="item in pagedata.item.diyfileds">
						<div ng-if="item.type==1 || item.type==2 || item.type==7 || item.type==8 || item.type==9 || item.type==13 || item.type==18" class="text">{{item.title}}：<span class="text-gray">{{item.data}}</span></div>
						<div ng-if="item.type==4" class="text">{{item.title}}：<span class="jylabel jylabel-success">{{item.data}}</span></div>
						<div ng-if="item.type==5" class="text">{{item.title}}：<span style="margin-left:0.2rem" ng-repeat="v in item.data" class="jylabel jylabel-success">{{v}}</span></div>
						<div ng-if="item.type==3" class="fui-card-images">
							<img ng-src="{{tomedia(item.data) || '../core/resource/images/nopic.jpg'}}" style="width:100%;padding:1px" />
						</div>
						<div ng-if="item.type==10" class="fui-card-images">
							<img ng-repeat="img in item.data track by $index" ng-src="{{tomedia(img) || '../core/resource/images/nopic.jpg'}}" style="width:100%;padding:1px" />
						</div>
						<div ng-if="item.type ==11" class="fui-video">
							<video src="{{tomedia(item.data)}}" poster="{{tomedia(item.thumb)}}" height="180" width="100%" controls="" x5-playsinline="" playsinline="" webkit-playsinline="" poster="" preload="auto"></video>
						</div>
					</div>
				</div>
					<div class="text-gray">{{pagedata.item.remark}}</div>
					<div ng-if="pagedata.item.images" class="fui-card-images">
						<img ng-repeat="img in pagedata.item.images track by $index" ng-src="{{tomedia(img) || '../core/resource/images/nopic.jpg'}}" style="width:100%;padding:1px" />
					</div>
					<div ng-if="pagedata.item_type.type ==11" class="fui-video">
						<video src="{{tomedia(pagedata.item_type.data)}}" height="180" width="100%" controls="" x5-playsinline="" playsinline="" webkit-playsinline="" poster="" preload="auto"></video>
					</div>
			</div>

			<div class="fui-cell-group fui-more-group">
				<div class="fui-cell" style="padding:0">
					<div class="fui-tag"><i class="icon icon-map" style="font-size:0.66rem"></i></div>
					<div class="fui-cell-text" style="color:#333;margin-top:0.5rem" ng-click="pagedata.openLocation();">
						<div style="width:100%;"><span style="color:#61bba7">{{pagedata.item.province+pagedata.item.city+pagedata.item.district || '暂时无地址'}} </span></div>
						<div class="subtitle" style="width:100%;margin-top:0.2rem">{{pagedata.item.address || '暂时没有详细地址提供！'}}</div>
					</div>
				</div>
			</div>
			<div class="item-buy-log">
				<div style="margin:0.2rem;font-size:0.56rem;color:#999"><span>联系人：{{pagedata.item.name}}</span><br/><span>联系电话：{{pagedata.item.mobile}}</span><br/><span ng-if="pagedata.item.weixin">微信：{{pagedata.item.weixin}}</span></div>
			</div>
			<a href="tel:{{pagedata.item.mobile}}" class='btn btn-success block' style="margin:1rem;border-radius: 1rem;"><i class="icon icon-phone"></i> 拨打电话</a>
			<a ng-if="!pagedata.item.isgetred && pagedata.item.redmoney>0" href='javascript:;' ng-click="pagedata.showredpack()" class='btn btn-red block' style="margin:1rem;border-radius: 1rem;color:#fff"><i class="icon icon-wodezichan"></i> 抢红包</a>
			<a ng-if="pagedata.item.isgetred && pagedata.item.redmoney" class='btn btn-red block' ng-click="access_json('/getred/look/pid='+pagedata.item.id)" style="margin:1rem;border-radius: 1rem;color:#fff"><i class="icon icon-wodezichan"></i> 已抢红包,查看记录</a>
			<div class="item-line-nav" ng-click="pagedata.setmsg(0);" >
				<i class="icon icon-shuru"></i> <span class="subtitle">已有{{pagedata.item.msgnum || 0}}条留言，快来说说您的感想吧！</span>
			</div>
			
			<div class="fui-cell-group fui-comment-group">	
				<div class="fui-cell external reply-list" ng-repeat="item in pagedata.item.msg" style="padding:0.2rem 0;align-items:stretch;-webkit-align-items:stretch">
					<div class="fui-list-media" style="width:2.3rem;margin-left:0.2rem;text-align:center;">
						<a class="reply-avatar l-f" ng-click="access_json('/user.index//id='+row.member.id)" style="height:100%;">
							<div><img src="{{tomedia(item.member.avatar) || '../core/resource/images/gw-user.png'}}" class="round" style="height:2rem;width:2rem"></div>
							<div class="l-f bold" style="margin:0.2rem 0;width:100%;text-align:center;color:#000"></div>
							<div class="l-f" style="width:100%;text-align:center;font-size:0.56rem;color:#999"></div>
							<div class="l-f" style="width:100%;text-align:center;font-size:2rem;color:#999;line-height:0.6;margin-top:-1rem">.</div>
							<div class="l-f" style="width:2px;margin:0.3rem 1.05rem;font-size:2rem;color:#999;height:100%;border-left: 2px solid #ebebeb;"></div>
						</a>
					</div>
					<div class="fui-list-inner">
						<div class="text click">
							<span style="font-size:0.56rem;color:#999">{{item.member.nickname || '匿名'}}</span>
							<span class="pull-right" style="font-size:0.56rem;color:#666">{{item.createtime || '2019-01-22 09:46'}}</span>
							<span ng-if="row.isAuthor==1" class="level-label fui-label fui-label-warning level-label">楼主</span>
						</div>
						<div class="text text-reply click bold" style="padding:0.2rem">{{item.comment || '转发成功'}}</div>
						<div class="text text-time" style="height:1rem;margin:0.2rem">
							<div class="pull-right">
								<a ng-click="pagedata.setmsg(item.id);" class="link link-reply" style="font-size:0.5rem;color:#999"><i class="icon icon-pingjia3" style="font-size:0.5rem;color:#999"></i> 回复&nbsp;&nbsp;</a>
								<!--<a ng-click="post({'cid':item.id},'msglike')" class="link link-good" isgood="0"><i class="icon icon-good" ng-class="{'fill':row.isgood>0}" style="font-size:0.5rem;color:#999"></i>
								   <span class="zandiv" style="font-size:0.5rem;color:#999">赞</span>
									&nbsp;&nbsp;</a>
								<!--<a ng-click="access_json('/post.index/complain/id='+pagedata.post.id)" class="link link-complain-list" data-id="9">
									<i class="icon icon-warning" style="font-size:0.5rem;color:#999"></i> <span style="font-size:0.5rem;color:#999">投诉</span>
								</a>-->
								<a ng-if="pagedata.isManager==1 || pagedata.isSuperManager==1" href="javascript:;" class="link link-delete" style="font-size:0.5rem;color:#999"><i class="icon icon-delete" style="font-size:0.5rem;color:#999"></i> 删除</a>
							</div>
						</div>
						<div class="text text-parent" ng-if="item.msglike.length>0 || item.msg.length>0" style="padding:0.5rem;background-color: #f9f9f9;border-radius: 10px;">
							<div class="item-follow-line" ng-if="item.msglike.length>0">
								<span><i class="icon icon-favorites" style="font-size:0.56rem"></i></span><span ng-repeat="a in item.msglike"> {{a.member.nickname}}</span>
							</div>
							<div class="item-msg-line" ng-repeat="m in item.msg"><span class="org" style="color:#999;">{{m.member.nickname}}</span>: {{m.title}}</div>
						</div>
					</div>
				</div>
			</div>
			<div class="fui-cell-group" style="margin-top:0">
				<div class="fui-tab fui-tab-success">
						<a ng-class="{'active':pagedata.params.ishot!=1}" ng-click="pagedata.params.ishot=0;tool.get_list('jy_zhaopin/index/getlist/isitem=1&pid='+pagedata.item.type+'&ishot=0'+'&lat='+pagedata.item.lat_lng.lat+'&lng='+pagedata.item.lat_lng.lng,true);">附近信息</a>
						<a ng-class="{'active':pagedata.params.ishot==1}" ng-click="pagedata.params.ishot=1;tool.get_list('jy_zhaopin/index/getlist/isitem=1&pid='+pagedata.item.type+'&ishot=1',true);">推荐信息</a>
				</div>
			</div>
			<div class="fui-list-group merchgroup">
				<div class="fui-card fui-card-list fui-card-full post-card" ng-repeat="row in pagedata.list">
						<a class='fui-card-info' style="margin-bottom:0.3rem" ng-click="access_json('/item_detail//id='+row.id)" >
							<div class="image">
								<img ng-src="{{tomedia(row.member.avatar) || '../core/resource/images/nopic.jpg'}}"/>
							</div>
							<div class="text">
								<span class="title" style="height:1rem;color:#f60">{{row.member.nickname || '匿名'}} <i ng-if="row.merchid" class="icon icon-dianpu" style="color:red"></i><span ng-if="row.mobile" href="tel:{{row.mobile}}" class="r-f btn btn-success"  style="line-height:1.3rem;height:1.3rem;max-width:5rem"><i class="icon icon-phone"></i> 拨打电话</span></span>
								<span class="subtitle" style="font-size:0.5rem;padding-top:0.1rem">{{row.createtime || '1天前'}} 发布</span>
							</div>
						</a>
						<div class="fui-card-content" style="margin-left:2.5rem;" ng-click="access_json('/item_detail//id='+row.id)" >
							<b class="fui-card-content-title">
								{{row.title || '未知标题'}} <span ng-if="row.redmoney>0" class="red" style="font-weight:400;font-size:0.55rem"><i class="icon icon-wodezichan"></i>有红包</span>
							</b>			
						</div>
						<div class="fui-card-images" style="margin-left:2.7rem;padding:0.2rem;" ng-click="access_json('/item_detail//id='+row.id)">
							<p>{{row.remark}} </p>
								<img ng-repeat="(imgkey,img) in row.images track by $index" ng-if="imgkey<9" ng-src="{{tomedia(img) || '../core/resource/images/nopic.jpg'}}"  style="width:5rem;height:5rem;object-fit: cover;margin:0 0.1rem" />
						</div>
						<div style="margin:0.2rem 0.5rem 0.2rem 2.7rem;padding: 0.2rem;">
							<div class="subtitle" style=""><i class="icon icon-map" style="font-size:0.66rem"></i> <a ng-click="pagedata.openLocation(row);" style="color:#61bba7">{{row.province+row.city+row.district+row.address || '暂时无地址'}} </a> <span ng-if="row.juli">(距离：{{row.juli}}km)</span></div>
							<div style="margin:0.2rem;font-size:0.56rem;color:#999"><span>有{{row.looks || 18}}人看过</span><span style="color:#09ba07;float:right"></span></div>
						</div>		
						<div style="margin:0.3rem 0.7rem 0.3rem 2.7rem;font-size:0.56rem;color:#999;height:1rem"><span style="float:right"><span ng-if="row.isme ==1" ng-click="post({},'del','id='+row.id,'','确认删除吗？')"><i class="icon icon-shanchu1" style="color:#000"></i> 删除</span> <span ng-click="pagedata.setshoucang(row.id);toogle(row,'isshoucang',[1,0])" style="margin-left:1rem"><i ng-class="{'icon jinyunicon':1, 'icon-favorite':row.isshoucang!=1,'icon-favoritesfilling':row.isshoucang==1}"></i> {{row.isshoucang !=1?'收藏':'已收藏'}}</span> <span style="margin-left:1rem" onclick="$('#showremark').modal();" ng-click="pagedata.post.pid=row.id"><i class="icon icon-pingjia3" style="color:#000"></i> 留言</span><span style="margin-left:1rem" onclick="$('#showsharecover').modal();"><i class="icon icon-skip" style="color:#000"></i> 转发</span></span></div>
						<div ng-if="row.msg.length>0" style="margin:0.2rem 0.7rem 0.2rem 2.7rem;padding: 0.5rem;background-color: #f9f9f9;border-radius: 10px;">
							<div ng-repeat="m in row.msg" style="font-size:0.56rem"><span>{{m.member.nickname || '匿名'}}</span>：<span style="color:#999">{{m.comment || '无效留言'}}</span></div>
							<div ng-if="row.msgnum>5" style="margin-top:0.5rem;font-size:0.56rem;color:#999">还有{{row.msgnum -5}}条留言</div>
						</div>
						<div ng-if="$index%6==0 && pagedata.setting.diy_adimg">
							<a class='fui-card-info' style="margin-bottom:0.3rem" ng-click="access_json(pagedata.setting.diy_adlink)" >
								<div class='image'>
									<img ng-src="../addons/jy_zhaopin/resource/images/adlogo.jpg"  />
								</div>
								<div class="text">
									<span class="title" style="height:1rem;font-size:0.65rem">{{pagedata.setting.diy_adtitle || '未知标题的广告'}}</span>
									<span class="subtitle" style="font-size:0.5rem;padding-top:0.1rem">{{row.createtime || '1天前'}} 发布 [广告]</span>
								</div>
							</a>
							<div>
								<div class="fui-card-images" style="margin-left:2.7rem;padding:0.2rem;" ng-click="access_json(pagedata.setting.diy_adlink)" >
									<img ng-src="{{tomedia(pagedata.setting.diy_adimg) || '../core/resource/images/nopic.jpg'}}" style="width:80%;height:3rem" />
								</div>
							</div>
						</div>
					</div>
				</div>
		</div>
	</div>
</div>
<!--分享弹层-->
<div id="showsharecover" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:100%;left:0;top:0">
	<div id="cover">
		<div class='fui-mask-m visible'></div>
		<div class='arrow'></div>
		<div class='content'>请点击右上角<br/>通过【发送给朋友】<br/>转发给好友哦</div>
	</div>
</div>
</div>
<!--留言-->
<div id="showremark"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
	<div class="modal-dialog" style="width:100%;left:0;bottom:0">
		<div class="modal-bottom">
			<div class="fui-cell-group">
				<div class="fui-cell">
					<div class="fui-cell-label" style="width:100px;font-size:0.9rem">留言</div>
				</div>
				<div class="fui-cell">
					<div class="fui-cell-info c000">
						<textarea rows="5" placeholder="50字以内（选填）" ng-model="pagedata.post.msg"></textarea>
					</div>
				</div>
			</div>
			<div class="fui-navbar">
				<a aria-hidden="true" data-dismiss="modal" ng-click="post(pagedata.post,'setmsg')" class="nav-item btn btn-success confirmbtn">确定</a>
			</div>
		</div>
	</div>
</div>
<!-- 红包弹层 -->
<div id="showredpage" class="modal fade" tabindex="-1" style="z-index:99999;display:none;" data-backdrop="static">
<div class="modal-dialog" style="width:100%;left:0;top:0">
	<div style="position:fixed;left:30px;top:30px;right:30px;color:#ffcc00">
      <div style="height:380px;background-color:#c70000;border-radius:8px;text-align:center">
        <div style="height:300px;background-color:#e52600;border-top-left-radius:8px;border-top-right-radius:8px;border-bottom-left-radius:50% 40px;border-bottom-right-radius:50% 40px;box-shadow:0 1px 2px brown">
          <div class="js-who" style="padding-top:30%;padding-bottom:5px;">
            <img class="js-avatar" src="../core/resource/images/nopic.jpg" width="20px" height="20px" style="display:inline-block;border-radius:3px;margin-right:5px;" />
            <span class="js-text" style="">XXXX的红包</span>
          </div>	
          <div class="js-title" style="font-size:1.3em;font-weight:bold;">YYYYYY</div>
        </div>
        <div style="display:inline-block;position:relative;top:-40px;background-color:#FFCC66;border-radius:50%;width:80px;height:80px;line-height:80px"
             ng-click="pagedata.hideredpack();access_json('/getred/getred/pid='+pagedata.item.id)">
          <span style="font-size:32px;color:#e52600;">開</span>
       	</div>
      </div>
    
      <div style="text-align:center;margin-top:10px">
      	<i class="icon icon-cuowu" ng-click="pagedata.hideredpack()" style="font-size:1.5rem;"></i>
      </div>
  </div>
</div>
</div>
<script>
scope.pagedata.openLocation=function(){
	wx.openLocation({
		name: scope.pagedata.item.title, // 位置名
		address: scope.pagedata.item.address, // 地址详情说明
		scale: 20, // 地图缩放级别,整形值,范围从1~28。默认为最大
		infoUrl: '', // 在查看位置界面底部显示的超链接,可点击跳转
		success:function(){
			//alert(1111);
		}
	});
}
</script>
<script>
scope.pagedata.post = {}
scope.pagedata.post.money = 10
scope.pagedata.showhongbao=function(){
	$('body').addClass('fixed');
	$('#showhongbao').modal();
}
//获取点赞
scope.pagedata.setlike=function(){
	var params={
		data:{'like':scope.pagedata.islike},
		op:'like',
		callback:function(res){		
			if(res.success == 1){
				scope.message('点赞成功！');
				scope.pagedata.opus.likes++
				scope.$evalAsync();
			}
			
		}
	};
	scope.post_json(params);
}
//收藏
scope.pagedata.setshoucang=function(){
	var params={
		data:{'isshoucang':scope.pagedata.isshoucang},
		op:'shoucang',
		callback:function(res){
			scope.message(res)
		}
	};
	scope.post_json(params);
}
//获取关注
scope.pagedata.setfollow=function(){
	var params={
		op:'follow',
		callback:function(res){
			scope.message(res)
		}
	};
	scope.post_json(params);
}
//获取评选
scope.pagedata.setpingxuan=function(index){
	var fileds = scope.pagedata.item.fileds
	for (var i=0;i<fileds.length;i++){
		if(fileds[i].selected =='1'){
			scope.message('只能选择一次！','error');
			return false;
		}
	}
	var g = scope.pagedata.item.fileds[index]
	g.nums =g.nums?g.nums:0;
	var params={
		data:{'index':index},
		op:'pingxuan',
		callback:function(res){
				if(g.selected !=1){
					g.nums++
					g.selected =1
				}else{
					g.nums--
					g.selected =0
				}
				scope.pagedata.item.fileds[index] = g
				scope.$evalAsync();
		}
	};
	scope.post_json(params);
}
//获取留言
scope.pagedata.getmsg=function(){
	var params={
		data:{},
		op:'getmsg',
		callback:function(res){
			scope.$evalAsync();
		}
	};
	scope.post_json(params);
}
//提交留言
scope.pagedata.setmsg=function(cid){
	$('#showremark').modal();
	scope.pagedata.post.cid =cid;
}
//减少
scope.pagedata.minus=function(index){
	var g = scope.pagedata.item.fileds[index]
	if(g.total<=0){
		return false;
	}
	var params={
		data:{'type':0,'index':index},
		op:'setfileds',
		callback:function(res){
			g.total--;
			scope.pagedata.item.fileds[index] = g
			scope.pagedata.refresh();
			scope.$evalAsync();
		}
	};
	scope.post_json(params);
}
//增加
scope.pagedata.plus=function(index){
	var g = scope.pagedata.item.fileds[index]
	var params={
		data:{'type':1,'index':index},
		op:'setfileds',
		callback:function(res){
			g.total++;
			scope.pagedata.item.fileds[index] = g
			scope.pagedata.refresh();
			scope.$evalAsync();
		}
	};
	scope.post_json(params);
}
//刷新总数和总价
scope.pagedata.refresh=function(){
	var total=0,totalprice=0.00;
	angular.forEach(scope.pagedata.item.fileds,function(g){
		total+=parseInt(g.total);
		totalprice+=g.total*g.price;
	});
	var totalprice = totalprice.toString(); //将数字转换为字符串
	var pos_decimal = totalprice.indexOf('.'); //小数点的索引值
	 // 当整数时，pos_decimal=-1 自动补0  
	if (pos_decimal < 0) {  
			pos_decimal = totalprice.length;  
			totalprice += '.';  
	}

	// 当数字的长度< 小数点索引+2时，补0  
	while (totalprice.length <= pos_decimal + 2) {  
			totalprice += '0';  
	}  
	scope.pagedata.total=total;
	scope.pagedata.totalprice=totalprice;
}
// 红包弹层
scope.pagedata.showredpack = function() {
	var params={
		op:'pregetred',
      	data: {
          pid: scope.pagedata.item.id
        },
		callback:function(res){
          	$('#showredpage').find('.js-avatar').attr('src', res.red_sender_avatar);
          	$('#showredpage').find('.js-text').text(res.red_sender_name + '的红包');
          	$('#showredpage').find('.js-title').text(res.red_title);
			$('#showredpage').modal('show');
		}
	};
	scope.post_json(params);
}
scope.pagedata.hideredpack = function() {
	$('#showredpage').modal('hide');
}
if(scope.pagedata.item.tui_ids && scope.pagedata.item.tui_ids.length>0){
	scope.pagedata.list=scope.pagedata.item.tui_ids
}else{
	scope.pagedata.item.lat_lng=scope.pagedata.item.lat_lng?scope.pagedata.item.lat_lng:{}
	scope.tool.get_list('jy_zhaopin/index/getlist/ishot=0&isitem=1&pid='+scope.pagedata.item.type+'&lat='+scope.pagedata.item.lat_lng.lat+'&lng='+scope.pagedata.item.lat_lng.lng,true);
	//scope.pagedata.scroll_bottom=function(){
		//scope.tool.get_list('jy_zhaopin/index/getlist/isitem=1&pid='+scope.pagedata.item.type);
	//}
}
</script>